#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int Degital_sum(int num)
{
	int a = 0;
	if (num > 9)
	{
		return Degital_sum(num / 10) + num % 10;
	}
	else
	{
		return num;
	}
}
int main()
{
	int num = 0;
	scanf("%d", &num);
	int sum =Degital_sum(num);
	printf("%d", sum);
	return 0;
}